package com.ruoyi.bigbase.api;

import com.ruoyi.bigbase.api.domain.Customer;
import com.ruoyi.bigbase.api.domain.IntegralDetails;
import com.ruoyi.bigbase.api.factory.RemoteCustomerFactory;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "remoteCustomerService", value = ServiceNameConstants.BIGBASE_SERVICE, fallbackFactory = RemoteCustomerFactory.class)
public interface RemoteCustomerService {
    @PostMapping("/info/list")
    public TableDataInfo list(@RequestBody Customer customer, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/info/getInfo/{id}")
    public R<Customer> getCustomerInfo(@PathVariable("id") Integer id,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/details/addPoints")
    public AjaxResult addPoints(@RequestBody IntegralDetails integralDetails, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/details/compareByUserId/{userId}")
    public Integer getTimeByUserId(@PathVariable("userId") Integer userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);



}
